<?php
require_once APP_PATH.'/member/global.php';
class member_util_setting{

    const ANYONE = 0;
	const ONLY_FRIEND = 1;
	const ONLY_SELF = 3;

	const COMMENT_CLOSE = -1;
	const SEARCH_YES = 1;
	const SEARCH_NO = 0;

	const FOOTPRINT_YES = 1;
	const FOOTPRINT_NO = 0;

	const FRIEND_ANYONE = 1;
	const FRIEND_ONLYFRIEND = 0;
    
	static $ASTRO = array(
		array('白羊座', '3-21', '4-20'),
		array('金牛座', '4-21', '5-21'),
		array('双子座', '5-22', '6-21'),
		array('巨蟹座', '6-22', '7-22'),
		array('狮子座', '7-23', '8-23'),
		array('处女座', '8-24', '9-23'),
		array('天秤座', '9-24', '10-23'),
		array('天蝎座', '10-24', '11-22'),
		array('射手座', '11-23', '12-21'),
		array('魔羯座', '12-22', '1-20'),
		array('水瓶座', '1-21', '2-19'),
		array('双鱼座', '2-20', '3-20') 
	);
	static function getAstro($m, $d){
		if($m==0 or $d==0) return '';
		$find = null;
		$value = $m."0".(strlen($d)<2?"0$d":$d);
		foreach(self::$ASTRO as $item){
			$min = str_replace("-", "0", $item[1]);
			$max = str_replace("-", "0", $item[2]);
			if($value>=$min and $value<=$max){
				$find = $item;
				break;
			}
		}
		if($find){
			return $find[0];
		}else{
			return '摩羯座';
		}
	}

    /**
     * @desc  获取用户的性别
     * @param  $uid
     * @return string
     */
    static function getUserGender($uid){
		$row = member_util_login::getMemberInfo($uid);
		return ($row['gender_flag']==MEMBER_MALE)?'男':
			($row['gender_flag']==MEMBER_FEMALE?'女':'未知');
	}
	
	static function getThe($flag){
		return $flag==MEMBER_MALE?'他':($flag == MEMBER_FEMALE?'她':'TA');
	}
}
?>